#!/bin/bash

# SynapseTeam MVP 快速启动脚本
# 适用于 macOS

echo "🚀 SynapseTeam MVP 快速启动"
echo "=============================="

# 检查 Node.js 是否安装
if ! command -v node &> /dev/null; then
    echo "❌ 错误: 未找到 Node.js"
    echo "请先安装 Node.js: https://nodejs.org/"
    exit 1
fi

echo "✅ Node.js 版本: $(node --version)"

# 检查 npm 是否可用
if ! command -v npm &> /dev/null; then
    echo "❌ 错误: 未找到 npm"
    exit 1
fi

echo "✅ npm 版本: $(npm --version)"

# 检查是否在正确的目录
if [ ! -f "package.json" ]; then
    echo "❌ 错误: 请在 mvp 目录下运行此脚本"
    echo "正确路径: /Users/xueyuheng/research/my-team/project-src/mvp/"
    exit 1
fi

echo ""
echo "📦 安装依赖..."
npm install

if [ $? -eq 0 ]; then
    echo "✅ 依赖安装成功"
else
    echo "❌ 依赖安装失败"
    exit 1
fi

echo ""
echo "🎯 启动应用..."
echo "提示: 按 Cmd+Q 退出应用"
echo ""

npm start
